package com.xbai.goods.feign;

import com.github.pagehelper.PageInfo;
import com.xbai.entity.Result;
import com.xbai.goods.pojo.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author jxbai
 * @desc
 * @date 2021/2/1 0001
 */
@RequestMapping("/sku")
@FeignClient(value = "goods")
public interface SkuFeign {

    /***
     * 多条件搜索Sku数据
     * @param sku {@link Sku}
     * @return {@link Result}
     */
    @PostMapping(value = "/search" )
    Result<List<Sku>> findList(@RequestBody(required = false) Sku sku);

    /**
     * 根据审核状态查询SKU列表
     * @param status 审核状态
     * @return {@link List<Sku>}
     */
    @GetMapping("/status/{status}")
    Result<List<Sku>> findByStatus(@PathVariable String status);

    /***
     * Sku分页条件搜索实现
     * @param sku {@link Sku}
     * @param page 页码
     * @param size 页大小
     * @return {@link Result<PageInfo>}
     */
    @PostMapping(value = "/search/{page}/{size}" )
    Result<PageInfo> findPage(@RequestBody(required = false) Sku sku, @PathVariable  int page, @PathVariable  int size);
}
